Skip to content

setIosSwipeGestureEnabled

setIosSwipeGestureEnabled 함수는 iOS에서 화면을 스와이프하여 뒤로가기 기능을 활성화하거나 비활성화할 수 있어요.

시그니처

typescript
function setIosSwipeGestureEnabled(options: {
    isEnabled: boolean;
}): Promise<void>;

파라미터

  • options필수 · object

    스와이프하여 뒤로가기 기능을 활성화하거나 비활성화하는 옵션이에요.

    • options.isEnabled필수 · boolean

      화면을 스와이프하여 뒤로가기 기능을 활성화하거나 비활성화할 수 있어요. true를 설정하면 스와이프로 뒤로갈 수 있고, false를 설정하면 스와이프 뒤로가기 기능이 비활성화돼요.

반환 값

  • void

예제

iOS에서 화면 스와이프로 뒤로가기 기능을 활성화하거나 비활성화하기

스와이프 끄기 버튼을 눌러 화면 스와이프로 뒤로가기 기능을 비활성화하거나, 스와이프 켜기 버튼을 눌러 화면 스와이프로 뒤로가기 기능을 활성화할 수 있어요.

tsx
import { setIosSwipeGestureEnabled } from 'react-native-bedrock';
import { Button } from 'react-native';

function Page() {
 return (
   <>
    <Button title="스와이프 끄기" onPress={() => setIosSwipeGestureEnabled({ isEnabled: false })} />
    <Button title="스와이프 켜기" onPress={() => setIosSwipeGestureEnabled({ isEnabled: true })} />
   </>
 );
}